package com.bwie.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author: 鑫仔
 * @Date: 2025/7/22 09:45
 * @Description:
 **/

/**
 * 商品表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_prod")
public class Prod implements Serializable {
    /**
     * 商品ID
     */
    @TableId(value = "prod_id", type = IdType.AUTO)
    private Integer prodId;

    /**
     * SPU
     */
    @TableField(value = "prod_spu")
    @NotBlank(message = "请输入SPU")
    private String prodSpu;

    /**
     * 商品类型;0实物商品1虚拟商品2卡密/网盘
     */
    @TableField(value = "prod_kind")
    @NotNull(message = "请输入商品类型")
    private Integer prodKind;

    /**
     * 商品分类
     */
    @TableField(value = "prod_type")
    @NotNull(message = "请输入商品分类")
    private Integer prodType;

    /**
     * 商品分类
     */
    @TableField(value = "prod_status")
    private Integer prodStatus;

    /**
     * 商品名称
     */
    @TableField(value = "prod_name")
    @NotBlank(message = "请输入商品名称")
    private String prodName;

    /**
     * 商品品牌
     */
    @TableField(value = "brand_id")
    private Integer brandId;

    /**
     * 创建人卍
     *
     * @TableField(fill = FieldFill.INSERT)
     */
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 创建时间
     *
     * @TableField(fill = FieldFill.INSERT)
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)

    private Date createTime;

    /**
     * 更新人
     *
     * fill = FieldFill.UPDATE
     * 自动填充审计字段
     */
    @TableField(value = "update_by", fill = FieldFill.UPDATE)
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;

    /**
     * 商品单位
     */
    @NotNull(message = "请输入商品单位")
    @TableField(value = "unit_id")
    private Integer unitId;

    /**
     * 商品标签
     */
    @NotNull(message = "请输入商品标签")
    @TableField(value = "tag_id")
    private Integer tagId;

    /**
     * 供应商
     */
    @TableField(value = "appr")
    @NotBlank(message = "请输入供应商")
    private String appr;

    /**
     * 缩略图
     */
    @TableField(value = "prod_image")
    @NotBlank(message = "请输入缩略图")
    private String prodImage;


    @TableField(exist = false)
    private String prodKindName;
    @TableField(exist = false)
    private String typeName;
    @TableField(exist = false)
    private String brandName;
    @TableField(exist = false)
    private String unitName;
    @TableField(exist = false)
    private String tagName;

    private static final long serialVersionUID = 1L;
}